package com.ycrlkj.android.modulespublic.common.base;

import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;
import android.text.TextUtils;
import com.alibaba.android.arouter.launcher.ARouter;
import com.ycrlkj.android.modulesbase.libbase.utils.PropertiesUtil;

/**
 * 做一些基础的初始化操作
 */
public class BaseApplication extends Application {

    @SuppressLint("StaticFieldLeak")
    private static Context context;

    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();

        String isRelease = PropertiesUtil.getProperty("isRelease");

        if (!TextUtils.equals(isRelease, "true")) {
            ARouter.openLog();
            ARouter.openDebug();
        }

        ARouter.init(this);
    }

    public static Context getContext(){
        return context;
    }
}
